package com.xuwang.service.impl;

import com.github.pagehelper.PageHelper;
import com.xuwang.dto.HealthCardWarningDto;
import com.xuwang.mapper.HealthWarningGMapper;
import com.xuwang.service.HealthWarningServiceG;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class HealthWarningServiceGGImpl implements HealthWarningServiceG {

    @Resource
    private HealthWarningGMapper healthWarningGMapper;

    @Override
    public Map<String, Object> HealthWarning( int page, int limit) {
        Map<String, Object> map = new HashMap<>();
        PageHelper.startPage(page, limit);
        List<HealthCardWarningDto> healthCardWarningDtos = healthWarningGMapper.selectHealthCardWarning();
        System.out.println(healthCardWarningDtos);
        map.put("code", 200);
        map.put("data", healthCardWarningDtos);
        map.put("count", healthCardWarningDtos.size());
        return map;
    }
}
